package behavioral_pattern.chain_of_responsibility_pattern;

/**
 * 职责链式模式
 */
public class MainResponsibility {
    public static void main(String[] args) {
        Approver director = new Director("张无忌");
        Approver director2 = new VicePresident("杨哥");
        Approver director3 = new President("过劲");
        Approver director4 = new JinYong("金庸");

        director.setApprover(director2);
        director2.setApprover(director3);
        director3.setApprover(director4);

        PurchaseRequest request3 = new PurchaseRequest(4000, 10003, "购买降龙神掌");
        director.processRequest(request3);
        PurchaseRequest request = new PurchaseRequest(65000, 10001, "购买倚天剑");
        director.processRequest(request);
        PurchaseRequest request2 = new PurchaseRequest(100000, 10002, "购买神雕一只");
        director.processRequest(request2);



    }

}
